import { defineStore } from "pinia";

export const useLayoutStore = defineStore("feature", {
  state: () => ({
    count: 0,
    layoutTitle: "",
    layoutSubtitle: "",
    layoutBgImage: "",
    token: "",
  }),
  getters: {
    getLayoutTitle: (state) => state.layoutTitle,
    getLayoutSubtitle: (state) => state.layoutSubtitle,
    getLayoutBgImage: (state) => state.layoutBgImage,
    getToken:(state)=>state.token,
  },
  actions: {
    assignLayoutData(payload:any) {
      this.layoutTitle = payload.title;
      this.layoutSubtitle = payload.subtitle;
      this.layoutBgImage = payload.layoutBgImage;
    },
    setToken(token: string) {
      this.token = token;
    },
    clearToken(token: string) {
      console.log("clear")
      this.token = "";
    }
  },
});
